import { createRouter, createWebHashHistory } from "vue-router"
import Router from './router'
const routes = Router
const router = createRouter({
    history: createWebHashHistory(),
    routes
});

const neetToken = ['/Account']

router.beforeEach((to, from, next) => {
    if (neetToken.includes(to.path)) {
        if (localStorage.getItem('token')) {
            next()
        } else {
            next('/')
        }
    } else {
        next()
    }
})

export default router